package adfc2.render3d.tex;

import adfc2.Renderer3D;
import adfc2.render3d.TextureReference;
import com.sun.opengl.util.texture.Texture;

public class TexRefTile extends TextureReference {

    public final Texture texture;
    public final int tidx;
    public final int tw;
    public final int th;

    public TexRefTile(Texture texture, int tidx, int tw, int th) {
        this.texture = texture;
        this.tidx = tidx;
        this.tw = tw;
        this.th = th;
    }

    @Override
    public void activate(Renderer3D renderer) {
        renderer.ensureTextureSelected(texture);
        renderer.ensureTextureTile(tidx, tw, th);
    }
}
